package com.ftg.learn.day06;

import java.util.Arrays;

/**
 * 学习多维数组
 * 多维数组
 * 【】【】【】
 *
 * @author 布衣
 */
public class LearnTwoArray {

    public static void main(String[] args) {
        int[] as = new int[]{1, 2, 3};
        int[][] as01 = new int[2][4];

        as01[0][0] = 11;
        as01[0][1] = 12;
        as01[0][2] = 13;
        as01[0][3] = 14;

        as01[1][0] = 21;
        as01[1][1] = 22;
        as01[1][2] = 23;
        as01[1][3] = 24;

        System.out.println(as01[1][1]);

        System.out.println("遍历数组");
        for (int i = 0; i < as01.length; i++) {
            for (int j = 0; j < as01[i].length; j++) {
                System.out.print(as01[i][j] + "\t");
            }
            System.out.println();
        }

        for(int i = 0 ;i < as01.length;i++){
            System.out.println(Arrays.toString(as01[i]));
        }

        int[][] as02 = new int[3][3];

        for(int i= 0;i < as02.length;i++){
            for(int j = 0;j < as02[i].length;j++){
                as02[i][j] = i+1+j;
            }
        }

        System.out.println("输出");
        for(int i = 0 ;i < as02.length;i++){
            System.out.println(Arrays.toString(as02[i]));
        }

    }

}
